Recording medium recorded with program for detecting database operation timing, method of detecting database operation timing, and apparatus for detecting database operation timing

ABSTRACT

A recording medium includes a program causing a computer to execute the steps of (a) predicting a data storage condition of a database from a record operation, (b) computing a number of relocatable areas and a number of areas in an expansion direction based on the data storage condition predicted in the step (a), and (c) detecting operation timing with respect to the database based on the numbers computed in the step

BACKGROUND OF THE INVENTION

[0001] 1. Field of the Invention

[0002] The present invention generally relates to recording mediarecorded with a program for detecting database operation timing such astiming of performing page relocation in a database or timing ofperforming the capacity expansion of the database, methods of detectingdatabase operation timing, and apparatuses for detecting databaseoperation timing, and more particularly to a recording medium recordedwith a program for detecting database operation timing, a method ofdetecting database operation timing, and an apparatus for detectingdatabase operation timing which program, method, and apparatus detecttiming of performing page relocation in a database or timing ofperforming the capacity expansion of the database.

[0003] A network structure database employs prime pages and overflowpages, which are used when the prime pages have no space, so as toenable a high-speed access thereto.

[0004] Once on-line operations start, such a database requires page(record) relocation since record addition, deletion, or update createsfragmentary spaces in the prime and overflow pages. Further, if thedatabase seems to run out of its capacity, the capacity of the databasehas to be expanded.

[0005] Timing of performing the page relocation in or the capacityexpansion of such a database should be detected accurately with aminimum influence on the on-line operations.

[0006] 2. Description of the Related Art

[0007] Conventionally, a system administrator has judged the necessityof page relocation in or the capacity expansion of a database based onthe analysis results of a job executed to recognize the storagecondition of data in the database, that is, based on analysis results asto whether the number of regions that are not reusable due tofragmentation is large or small.

[0008] Then, if the system administrator determines, based on theanalysis results, that the number of reusable regions is so large thatthe database requires page relocation, the system administrator performsthe page relocation during a jog execution by activating a programconfigured in accordance with an invention disclosed in JapaneseLaid-Open Patent Application No. 6-110743.

[0009] Further, if the system administrator determines, based on theanalysis results, that such page relocation does not allow the databaseto store further data, the system administrator activates a program forimplementing the capacity expansion of the database so as to expand thecapacity of the database.

[0010] Thus, according to a conventional method, the systemadministrator judges the necessity of page relocation in or the capacityexpansion of the database by executing the job for recognizing the datastorage condition of the database. This job is executed at a timing whenthe on-line operations are stopped.

[0011] The job executed at this timing is input to and output from theentire database so as to recognize the data storage condition of thedatabase.

[0012] According to such a conventional method, however, the on-lineoperations should be stopped in order to judge the necessity of the pagerelocation in or the capacity expansion of the database, thus causing aproblem that a request for an on-line operation hour extension cannot beanswered. Especially, this is a problem in 24-hour continuous on-lineoperations.

[0013] Further, according to the conventional method, the systemadministrator, based on her/his experience, judges the necessity of thepage relocation in or the capacity expansion of the database, referringto the analysis results of the above-described job.

[0014] However, this does not mean that the page relocation in or thecapacity expansion of the database is always performed at an appropriatetiming.

[0015] Therefore, in the worst case, the conventional method causes theshortage of the capacity of the database so that an on-line program isprevented from storing records to end abnormally.

SUMMARY OF THE INVENTION

[0016] It is a general object of the present invention to provide arecording medium recorded with a program for detecting databaseoperation timing, a method of detecting database operation timing, andan apparatus for detecting database operation timing in which theabove-described disadvantage is eliminated.

[0017] A more specific object of the present invention is to provide arecording medium recorded with a program for detecting databaseoperation timing, a method of detecting database operation timing, andan apparatus for detecting database operation timing which program,method, and apparatus accurately detect timing of performing pagerelocation in a database or timing of performing the capacity expansionof the database with a minimum influence on on-line operations.

[0018] The above objects of the present invention are achieved by arecording medium including a program causing a computer to execute thesteps of (a) predicting a data storage condition of a database from arecord operation, (b) computing a number of relocatable areas and anumber of areas in an expansion direction based on the data storagecondition predicted in the step (a), and (c) detecting operation timingwith respect to the database based on the numbers computed in the step(b).

[0019] The above objects of the present invention are also achieved by arecording medium including a program causing a computer to execute thesteps of (a) determining whether a new overflow area is generated by arecord operation, (b) determining whether fragmentation is generated ina prime area or overflow areas including the new overflow area linkedthereto by the record operation if it is determined in the step (a) thatthe new overflow area is generated, (c) computing a number ofrelocatable areas and a number of areas in an expansion direction basedon a result of the step (b), and (d) detecting operation timing withrespect to the database based on the numbers computed in the step (c).

[0020] The above objects of the present invention are also achieved by amethod of detecting database operation timing which method includes thesteps of (a) determining whether a new overflow area is generated by arecord operation, (b) determining whether fragmentation is generated ina prime area or overflow areas including the new overflow area linkedthereto by the record operation if it is determined in the step (a) thatthe new overflow area is generated, (c) computing a number ofrelocatable areas and a number of areas in an expansion direction basedon a result of the step (b), and (d) detecting operation timing withrespect to the database based on the numbers computed in the step (c).

[0021] The above objects of the present invention are further achievedby an apparatus for detecting database operation timing which apparatusincludes a first determination part for determining whether a newoverflow area is generated by a record operation, a second determinationpart for determining whether fragmentation is generated in a prime areaor overflow areas including the new overflow area linked thereto by therecord operation if it is determined by the first determination partthat the new overflow area is generated, a computation part forcomputing a number of relocatable areas and a number of areas in anexpansion direction based on a determination result of said seconddetermination part, and a detection part for detecting operation timingwith respect to the database based on the numbers computed by thecomputation part.

[0022] According to the above-described recording media, method, andapparatus, the necessity of page relocation in or the capacity expansionof the database can be judged without executing a job for recognizingthe data storage condition of the database. Therefore, on-lineoperations are prevented from a stoppage, thus minimizing influencethereon.

[0023] Further, the necessity of page relocation in or the capacityexpansion of the database can be judged without depending on a systemadministrator, thus preventing unnecessary page relocation in thedatabase or an unnecessary capacity expansion thereof from beingperformed.

BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Other objects, features and advantages of the present inventionwill become more apparent from the following detailed description whenread in conjunction with the accompanying drawings, in which:

[0025]FIG. 1 is a diagram showing a structure of a computer systemaccording to the present invention;

[0026]FIG. 2 is a diagram showing a program structure of a DB managementmechanism shown in FIG.

[0027]FIG. 3 is a diagram for illustrating an NDB shown in FIGS. 1 and2;

[0028]FIG. 4 is a diagram showing embodiments of a prime area and anoverflow area of the NDB;

[0029]FIG. 5 is a diagram for illustrating an operation of an overflowmanagement page shown in FIG. 4;

[0030]FIG. 6 is a diagram showing an embodiment of prediction managementinformation of each prime page shown in FIGS. 4 and 5;

[0031]FIG. 7 is a diagram for illustrating an overflow page managementoperation performed by an overflow management page shown in FIGS. 4 and5;

[0032]FIGS. 8A and 8B are flowcharts of an operation performed by adatabase access program shown in FIGS. 2 and 3;

[0033]FIGS. 9 and 10 are flowcharts of an operation performed by anoverflow prediction management program shown in FIG. 2;

[0034]FIG. 11 is a diagram showing cases to which a record operationcorresponds in step S5 of FIG. 9;

[0035]FIG. 12 is a diagram for illustrating a prediction managementupdate operation performed in step 6 of FIG. 9;

[0036]FIG. 13 is a diagram for illustrating a method of determiningtimings to perform page relocation in the NDB and an expansion thereofin steps 7 through 14 in FIGS. 9 and 10;

[0037]FIG. 14 is a diagram for illustrating the page relocation in andthe expansion of the NDB; and

[0038]FIGS. 15A through 17B are diagrams for illustrating an operationof a system of FIG. 14 according to the present invention.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0039] A description will now be given, with reference to theaccompanying drawings, of an embodiment of the present invention.

[0040]FIG. 1 is a diagram showing a structure of a computer systemaccording to the present invention. As shown in FIG. 1, the computersystem includes an operating system (OS) 1, an application program 2, aterminal 3, a network structure database (NDB) 4, an expansion NDB 5capacity-expanded from the NDB 4, a terminal control mechanism 6operating under the OS 1 to control the terminal 3, a database (DB)management mechanism 7 operating under the OS 1 to manage the NDB 4 andthe expansion NDB 5, and a transaction control mechanism 8 forcontrolling transactions.

[0041]FIG. 2 is a diagram showing a program structure of the DBmanagement mechanism 7.

[0042] As shown in FIG. 2, the DB management mechanism 7 includes anoverflow prediction management program 11 provided to realize thepresent invention as well as a conventionally provided database accessprogram 10.

[0043] As will be described later, the overflow prediction managementprogram 11 updates prediction management information 400 recorded inprime pages, performs an addition operation of an overflow page, andposts an instruction for page relocation in the NDB 4 or the expansionNDB 5, and an instruction for the generation of the expansion NDB. Theoverflow prediction management program 11 can be stored in anappropriate recording medium such as a computer-readable semiconductormemory.

[0044]FIG. 3 is a diagram for illustrating the NDB 4.

[0045] The NDB 4 is accessed by the record, and, as shown in FIG. 3,employs two types of pages (input/output units) of the prime pagesloaded into a prime area 40 and overflow pages loaded into an overflowarea 41. The NDB 4 uses the prime pages prior to the overflow pages. Ifthere is no space in the prime pages, the NDB 4 uses the overflow pages.If there is no space in the overflow pages, the NDB 4 allocates the nextoverflow page from the overflow area 41. Thereby, the NDB 4 enables ahigh-speed access thereto.

[0046] If the NDB 4 is filled to its capacity, overflow pages loadedinto an overflow area 50 of the expansion NDB 5 are used.

[0047]FIG. 4 is a diagram showing embodiments of the prime area 40 andthe overflow area 41 of the NDB 4.

[0048] The overflow area 50 of the expansion NDB 5 has the samestructure as the overflow area 41 of the NDB 4.

[0049] As shown in FIG. 4, each prime page loaded into the prime area 40has the two-bit prediction management information 400. On the otherhand, an overflow management page 410 is provided in the overflow area41 to manage the numbers of expansion pages (pages in an expansiondirection) and relocation (relocatable) pages.

[0050]FIG. 5 is a diagram for illustrating an operation of the overflowmanagement page 410.

[0051] In addition to the management of the numbers of expansion pagesand relocation pages, the overflow management page 410 identifies anoverflow page in use by using a link as shown in FIG. 5.

[0052] A record to be stored in a prime page identifies overflow pageslinked to the prime page by using a pointer, which is not shown in FIG.5.

[0053]FIG. 6 is a diagram showing an embodiment of the predictionmanagement information 400 of each prime page.

[0054] As shown in FIG. 6, the prediction management information 400 isformed of two bits, and manages a value “00” in an initial state, avalue “10” if a prime page having the prediction management information400 and overflow pages linked to the prime page are relocatable, and avalue “11” if the prime page and the overflow pages linked thereto arein the expansion direction.

[0055] That is, the values “10” and “11” of the prediction managementinformation 400 indicate, respectively, that a page set of the primepage and the overflow pages linked thereto has fragmentation and thus isrelocatable, and that the page set has no fragmentation and thus is inthe expansion direction.

[0056]FIG. 7 is a diagram for illustrating an overflow page managementoperation.

[0057] For instance, as shown in FIG. 7, if the prediction managementinformation 400 of a prime page i is recorded with the value “10”, it isindicated that a page set of the prime page i and overflow pages linkedthereto has fragmentation, and thus is relocatable. If the predictionmanagement information 400 of a prime page p is recorded with the value“11”, it is indicated that a page set of the prime page p and overflowpages linked thereto has no fragmentation, and thus is in the expansiondirection.

[0058] The number of expansion pages managed by the overflow managementpage 410 is the total number of the overflow pages of the page set inthe expansion direction. In FIG. 7, the overflow management page 410manages the number “4” as the number of expansion pages.

[0059] On the other hand, the number of relocation pages managed by theoverflow management page 410 is the total number of the overflow pagesof the relocatable page set. In FIG. 7, the overflow management page 410manages the number “3” as the number of relocation pages.

[0060] If fragmentation is generated in the page set in the expansiondirection, the page set becomes relocatable. In this case, theprediction management information 400 has the value “11” updated to thevalue “10” as shown in FIG. 6.

[0061] If the fragmentation disappears in the relocatable page set, thepage set is to be in the expansion direction. However, this seldomhappens and is quite exceptional. Therefore, the page set in whichfragmentation is once generated is considered as relocatable even if anew overflow page is added to the page set after the generation of thefragmentation. Consequently, as shown in FIG. 6, once the predictionmanagement information 400 is set to the value “10”, the value “10” isnever updated to the value “11”.

[0062]FIGS. 8A and 8B are flowcharts of an operation performed by thedatabase access program 10, and FIGS. 9 and 10 are flowcharts of anoperation performed by the overflow prediction management program 11.

[0063] Next, a description will be given of the present invention inaccordance with these flowcharts.

[0064] First, a description will be given of the operation performed bythe database access program 10.

[0065] As shown in FIG. 8A, the database access program 10 performs aninitialization operation to reserve a work area when a transactionstarts.

[0066] On the other hand, when the transaction ends, as shown in FIG.8B, the database access program 10 first determines in step S1 whetheror not the prediction management information 400 of a prime page isupdated and/or the number of expansion pages and/or the number ofrelocation pages managed by the overflow management page 410 are/isupdated by a record operation in the transaction.

[0067] If it is determined in step S1 that such a prediction managementupdate operation, which is performed by the overflow predictionmanagement program 11 as will be described later, is not performed, theoperation proceeds to step S2. In step S2, the prime page and theoverflow pages read in response to the issuance of the macro instructionfor the record operation are written to the NDB 4 in a direct accessstorage device (DASD), and then the operation ends.

[0068] On the other hand, if it is determined in step S1 that aprediction management update operation is performed, the operationproceeds to step S3. In step S3, the updated prediction managementinformation 400 of the prime page is written to the NDB 4 in the DASD,and in step 4, the updated number of expansion pages and/or the updatednumber of relocation pages managed by the overflow management page 410are/is written to the NDB 4 in the DASD.

[0069] Next, in step S5, the rest of the prime page and the overflowpages are written to the NDB 4 in the DASD, and then the operation ends.

[0070] Thus, when the transaction ends, the database access program 10writes to the NDB 4 in the DASD the prime page and overflow pages readin response to the issuance of the macro instruction for the recordoperation, and the overflow management page 410. Thereafter, thedatabase access program 10 terminates the operation.

[0071] Next, a description will be given of the operation performed bythe overflow prediction management program 11.

[0072] If the database access program 10 issues a macro instruction fora record operation in response to a request from the application program2 in a transaction, the overflow prediction management program 11 firstdetermines in step S1 whether the issued macro instruction is of anupdate type as shown in FIG. 9.

[0073] If it is determined in step S1 that the issued macro instructionis not of an update type, that is, if it is determined that the issuedmacro instruction is for a record retrieval, it is determined that abelow-described prediction management is unnecessary, the operation endswithout performing further steps.

[0074] On the other hand, if it is determined in step S1 that the issuedmacro instruction is of an update type, such as a record addition,deletion, or update, the operation proceeds to step S2. In step S2, apredicted size of a record (a record length) processed by the macroinstruction is obtained from the database access program 10.

[0075] Next, in step S3, it is determined whether the database accessprogram 10 performs the record operation on an overflow page in responseto the issuance of the macro instruction. If it is determined in step S3that the record operation is not performed on the overflow page, thatis, if it is determined that the record operation is performed on aprime page, it is determined that a below-described predictionmanagement is unnecessary, and the operation ends without performingfurther steps. This is because, at this stage, no relocatable orcapacity expansion state is generated, that is, no page set isrelocatable or in the expansion direction.

[0076] On the other hand, if it is determined in step S3 that thedatabase access program 10 performs the record operation on the overflowpage, the operation proceeds to step S4. In step S4, it is determinedwhether the database access program 10 allocates a new overflow pageduring the transaction in process. If it is determined in step S4 that anew overflow page is not allocated in the transaction, it is determinedthat a below-described prediction management is unnecessary, and theoperation ends without performing further steps. This is because, atthis stage, no relocatable or capacity expansion state is generated.

[0077] On the other hand, if it is determined in step S4 that a newoverflow page is allocated in the transaction, the operation proceeds tostep S5. In step S5, it is determined which case the record operationperformed by the database access program 10 this time corresponds tobased on record operation types and predicted sizes of records (recordlengths) of last time and this time.

[0078]FIG. 11 is a diagram showing cases to which the record operationcorresponds. For convenience of description, a description will be givenof typical six cases.

[0079] If a record length deleted by the last operation is equal to thatadded by this operation, it is determined that this operationcorresponds to CASE 1 having a future prediction of NO CHANGE.

[0080] If a record length deleted by the last operation is longer thanthat added by this operation, it is determined that this operationcorresponds to CASE 2 having a future prediction of EXPANSION DIRECTION.

[0081] If a record length deleted by the last operation is shorter thanthat added by this operation, it is determined that this operationcorresponds to CASE 3 having a future prediction of RELOCATABLEindicating generation of fragmentation.

[0082] If a record length updated by the last operation is equal to thatupdated by this operation, it is determined that this operationcorresponds to CASE 4 having the future prediction of NO CHANGE.

[0083] If a record length updated by the last operation is longer thanthat updated by this operation, it is determined that this operationcorresponds to CASE 5 having the future prediction of EXPANSIONDIRECTION.

[0084] If a record length updated by the last operation is shorter thanthat updated by this operation, it is determined that this operationcorresponds to CASE 6 having the future prediction of RELOCATABLEindicating generation of fragmentation.

[0085] Next, in FIG. 9, after it is determined in step S5 which case therecord operation performed by the database access program 10 this timecorresponds to, in step S6, a prediction management update operation isperformed to update the prediction management information 400 of theprime page and/or the number of expansion pages and/or the number ofrelocation pages managed by the overflow management page 410 based onthe case to which the record operation corresponds.

[0086]FIG. 12 is a diagram for illustrating the prediction managementupdate operation.

[0087] For instance, if the record operation performed by the databaseaccess program 10 corresponds to CASE 1 or 4, the value of theprediction management information 400 of the prime page is not updatedas shown in FIG. 12.

[0088] In this case, if the value of the prediction managementinformation 400 indicates “10 (RELOCATABLE)”, the number of relocationpages managed by the overflow management page 410 is incremented by one,and if the value of the prediction management information 400 indicates“11 (EXPANSION DIRECTION)”, the number of expansion pages managed by theoverflow management page 410 is incremented by one.

[0089] In the case where the record operation performed by the databaseaccess program 10 corresponds to CASE 2 or 5, as shown in FIG. 12, thevalue of the prediction management information 400 is updated to “11(EXPANSION DIRECTION)” if the value indicates “00 (INITIAL STATE)”, butis not updated for the reason previously described with reference toFIG. 6 if the value indicates “10 (RELOCATABLE)”. The value is notupdated either if the value indicates “11 (EXPANSION DIRECTION)”, forthere is no change in the future prediction.

[0090] At this point, if the value of the prediction managementinformation 400 is updated from “00 (INITIAL STATE)” to “11 (EXPANSIONDIRECTION)”, a value “1” is entered in the number of expansion pagesmanaged by the overflow management page 410. In the case where the valueis not updated, the number of relocation pages managed by the overflowmanagement page 410 is incremented by one if the value indicates “10(RELOCATABLE)”, and the number of expansion pages is incremented by oneif the value indicates “11 (EXPANSION DIRECTION)”.

[0091] In the case where the record operation performed by the databaseaccess program 10 corresponds to CASE 3 or 6, as shown in FIG. 12, thevalue of the prediction management information 400 of the prime page isupdated to “10 (RELOCATABLE)” if the value indicates “00 (INITIALSTATE)” or “11 (EXPANSION DIRECTION)”, is not updated if the valueindicates “10 (RELOCATABLE)”, for there is no change in the futureprediction.

[0092] At this point, if the value is updated from “00 (INITIAL STATE)”to “10 (RELOCATABLE)”, a value “1” is entered in the number ofrelocation pages managed by the overflow management page 410. If thevalue is not updated, the number of relocation pages is incremented byone. If the value is updated from “11 (EXPANSION DIRECTION)” to “10(RELOCATABLE)”, the number of all the overflow pages linked to the primepage is entered in the number of relocation pages, and the number ofexpansion pages is reset to an initial value “0”.

[0093] Thus, in step S6, the prediction management update operation isperformed so that the overflow management page 410 manages the numbersof expansion and relocation pages as described above in FIG. 7.

[0094] Next, in step S7, based on the total number of overflow pages(TN) loaded into the overflow area 41, which number is entered in theoverflow management page 410, and the numbers of expansion andrelocation pages (NE and NR) managed by the overflow management page410, the rate of use of overflow pages (RU) is given by the followingequation

RU=(NE+NR)/TN,

[0095] and the ratio of relocatable overflow pages (RR) and the ratio ofoverflow pages in the expansion direction (RE) are given by thefollowing equations

RR=NR/TN

RE=NE/TN

[0096] Next, as shown in FIG. 10, it is determined in step S8 whetherthe rate of use of overflow pages is higher than 90%. If it isdetermined in step S8 that the rate of use of overflow pages is higherthan 90%, the operation proceeds to step S9. In step S9, an instructionis issued to expand the NDB 4, and then the operation ends.

[0097] That is, if the rate of use of overflow pages is higher than 90%,the NDB 4 is almost filled to its capacity. Therefore, the instructionis issued to expand the NDB 4 irrespective of the ratio of relocatableoverflow pages or overflow pages in the expansion direction.

[0098] On the other hand, if it is determined in step S8 that the rateof use of overflow pages does not exceed 90%, the operation proceeds tostep S10 to determine whether the rate of use is higher than 70% andlower than or equal to 90%, whether the rate of use is higher than 50%and lower than or equal to 70%, and whether the rate of use is lowerthan or equal to 50%.

[0099] If it is determined in step S10 that the rate of use is lowerthan or equal to 50%, the operation ends without providing aninstruction to expand the NDB 4 or perform page relocation therein.

[0100] That is, if the rate of use is lower than or equal to 50%, theNDB 4 has sufficient space in its capacity. Therefore, no instruction isissued to expand the NDB 4 or perform page relocation therein.

[0101] On the other hand, if it is determined in step S10 that the rateof use is higher than 70% and lower than or equal to 90%, the operationproceeds to step S11 to determine whether the ratio of overflow pages inthe expansion direction (RE) is higher than 80%. If it is determined instep S11 that the RE is higher than 80%, the operation proceeds to stepS12 to issue an instruction to expand the NDB 4, and then the operationends.

[0102] That is, if the rate of use is higher than 70% and lower than orequal to 90% and the RE is higher than 80%, the NDB 4 is almost filledto its capacity. Therefore, the instruction is issued to expand the NDB4.

[0103] On the other hand, if it is determined in step S11 that the RE islower than or equal to 80%, or if it is determined in step S10 that therate of use is higher than 50% and lower than or equal to 70%, theoperation proceeds to step S13 to determine whether the ratio ofrelocatable overflow pages (RR) is higher than 30%.

[0104] If it is determined in step S13 that the RR is higher than 30%,the operation proceeds to step S14 to issue an instruction to performpage relocation in the NDB 4, and then the operation ends. On the otherhand, if it is determined in step S13 that the RR is lower than or equalto 30%, the operation ends without providing an instruction to performpage relocation in the NDB 4.

[0105] That is, if the rate of use is higher than 50% and lower than orequal to 70% and the RR is higher than 30%, it is desirable to lower therate of use by page relocation in the NDB 4. Therefore, the instructionis issued to perform page relocation in the NDB 4.

[0106] If the rate of use is higher than 50% and lower than or equal to70%, the RE is lower than or equal to 80% so that the expansion of theNDB 4 is not necessary, and the RR is higher than 30%, it is desirableto lower the rate of use by page relocation in the NDB 4. Therefore, theinstruction is issued to perform page relocation in the NDB 4.

[0107] Thus, the overflow prediction management program 11 predicts thedata storage condition of the NDB 4 from a record operation performed ina transaction so as to compute the rate of use of overflow pages, theratio of relocatable overflow pages, and the ratio of overflow pages inthe expansion direction, base on which the overflow predictionmanagement program 11 issues an instruction to expand the NDB 4 orperform page relocation therein in accordance with, for instance, adetermination method as shown in FIG. 13.

[0108] In the above-described steps, steps S1 through S4 form a firstdetermination step, step 5 forms a second determination step, step 6forms a computation step, and steps 7 through 14 form a detection stepof a method of detecting database operation timing.

[0109] Further, in the above-described steps, steps S1 through S4 form afirst determination part, step 5 forms a second determination part, step6 forms a computation part, and steps 7 through 14 form a detection partof an apparatus for detecting database operation timing.

[0110]FIG. 14 is a diagram for illustrating page relocation in and theexpansion of the NDB 4.

[0111] In response to the instruction to perform page relocation in theNDB 4 issued by the overflow prediction management program 11, arelocation program 100, for instance, is activated as shown in FIG. 14so as to perform page relocation in the NDB 4. At this point, it isdesirable that the object of page relocation should not be limited tothe relocatable overflow pages, but include all the overflow pages andall the prime pages,

[0112] On the other hand, in response to the instruction to expand theNDB 4 issued by the overflow prediction management program 11, a DBexpansion program 200, for instance, is activated as shown in FIG. 14 sothat the expansion NDB 5 is generated to expand from the NDB 4.

[0113] According to a system shown in FIG. 14, the relocation program100 or the DB expansion program 200 is activated in response to theinstruction issued by the overflow prediction management program 11 soas to automatically perform page relocation in the NDB 4 or theexpansion thereof. On the other hand, in some cases, a message toinstruct page relocation in the NDB 4 or the expansion thereof is outputon the display screen of the terminal 3 shown in FIG. 1.

[0114] Next, a description will be given, with reference to FIGS. 15Athrough 17B, of an operation of the system of the above-describedstructure.

[0115] If the database access program 10, during the execution of atransaction, receives an addition request of a record B of a recordlength of 400 after deleting a record A of a record length of 400 storedin a prime page as shown in FIG. 15A, the database access program 10store the record B in the prime page having a space of the record lengthof 400 as shown in FIG. 15B.

[0116] Thereafter, if the database access program 10 receives anaddition request of a record C of a record length of 500, the databaseaccess program 10 allocates a new overflow page to store the record Ctherein since the prime page is full as shown in FIG. 15C.

[0117] The overflow prediction management program 11 determines the caseof this record operation (the case of a series of additions) in thistransaction so as to determine that the NDB 4 is in the expansiondirection. Then, as shown in FIG. 16A, the overflow predictionmanagement program 11 sets the value of the prediction managementinformation 400 of the prime page to “11 (EXPANSION DIRECTION)”, andincrement the number of expansion pages managed by the overflowmanagement page 410 by one to set the number of expansion pages to “1”.Thereafter, at the end of the transaction, the overflow predictionmanagement program 11 writes the updated value of the predictionmanagement information 400 and the updated number of expansion pages tothe NDB 4 in the DASD.

[0118] Next, the database access program 10 fills the allocated overflowpage by executing several transactions as shown in FIG. 16B.

[0119] Thereafter, if the database access program 10, while executing atransaction following the preceding transactions, receives an additionrequest of a record E of a record length of 500 after deleting a recordD of a record length of 400 as shown in FIG. 16C, the database accessprogram 10 allocates a new overflow page to store the record E thereinsince the allocated overflow page is full as shown in FIG. 17A.

[0120] The overflow prediction management program 11 determines the caseof this record operation (the case of adding a record of a record lengthlonger than a space produced by deleting a record) in this transactionso as to determine that the NDB 4 is in condition to have pagerelocation. Then, as shown in FIG. 17B, the overflow predictionmanagement program 11 sets the value of the prediction managementinformation 400 of the prime page to “10 (RELOCATABLE)”, and sets thenumbers of expansion and relocation pages managed by the overflowmanagement page 410 to “0” and “2”, respectively. Thereafter, at the endof the transaction, the overflow prediction management program 11 writesthe updated value of the prediction management information 400 and theupdated numbers of expansion and relocation pages to the NDB 4 in theDASD.

[0121] Thus, the overflow prediction management program 11 detects thenumbers of expansion and relocation pages indicating the data storagecondition of the NDB 4 from record operations in transactions.

[0122] As previously described in FIGS. 9 and 10, the overflowprediction management program 11 issues an instruction to perform pagerelocation in the NDB 4 or the expansion thereof based on the predicteddata storage condition of the NDB 4.

[0123] The present invention is not limited to the specificallydisclosed embodiment, but variations and modifications may be madewithout departing from the scope of the present invention.

[0124] The present application is based on Japanese priority applicationNo. 2000-288116 filed on Sep. 22, 2000, the entire contents of which arehereby incorporated by reference.

1 4 327 base pairs nucleic acid double linear DNA (genomic) CDS 10..3121 CGATCGAAG CTT GGT AAA TTC TCC CAG ACC TGC TAC AAC TCC GCT ATC 48 LeuGly Lys Phe Ser Gln Thr Cys Tyr Asn Ser Ala Ile 1 5 10 CAG GGT TCC GTTCTG ACC TCC ACC TGC GAA CGT ACC AAC GGT GGT TAC 96 Gln Gly Ser Val LeuThr Ser Thr Cys Glu Arg Thr Asn Gly Gly Tyr 15 20 25 AAC ACC TCC TCC ATCGAC CTG AAC TCC GTT ATC GAA AAC GTT GAC GGT 144 Asn Thr Ser Ser Ile AspLeu Asn Ser Val Ile Glu Asn Val Asp Gly 30 35 40 45 TCC CTG AAA TGG CAGCCG TCC AAC TTC ATC GAA ACC TGC CGT AAC ACC 192 Ser Leu Lys Trp Gln ProSer Asn Phe Ile Glu Thr Cys Arg Asn Thr 50 55 60 CAG CTG GCT GGT TCC TCCGAA CTG GCT GCT GAA TGC AAA ACC CGT GCT 240 Gln Leu Ala Gly Ser Ser GluLeu Ala Ala Glu Cys Lys Thr Arg Ala 65 70 75 CAG CAG TTC GTT TCC ACC AAAATC AAC CTG GAC GAC CAC ATC GCT AAC 288 Gln Gln Phe Val Ser Thr Lys IleAsn Leu Asp Asp His Ile Ala Asn 80 85 90 ATC GAC GGT ACC CTG AAA TAC GAATAACTCGAGA TCGTA 327 Ile Asp Gly Thr Leu Lys Tyr Glu 95 100 101 aminoacids amino acid linear protein 2 Leu Gly Lys Phe Ser Gln Thr Cys TyrAsn Ser Ala Ile Gln Gly Ser 1 5 10 15 Val Leu Thr Ser Thr Cys Glu ArgThr Asn Gly Gly Tyr Asn Thr Ser 20 25 30 Ser Ile Asp Leu Asn Ser Val IleGlu Asn Val Asp Gly Ser Leu Lys 35 40 45 Trp Gln Pro Ser Asn Phe Ile GluThr Cys Arg Asn Thr Gln Leu Ala 50 55 60 Gly Ser Ser Glu Leu Ala Ala GluCys Lys Thr Arg Ala Gln Gln Phe 65 70 75 80 Val Ser Thr Lys Ile Asn LeuAsp Asp His Ile Ala Asn Ile Asp Gly 85 90 95 Thr Leu Lys Tyr Glu 100 327base pairs nucleic acid double linear DNA (genomic) CDS 1..327 3 GAC TACAAG GAC GAC GAT GAC AAG CTT GGT AAA TTC TCC CAG ACC TGC 48 Asp Tyr LysAsp Asp Asp Asp Lys Leu Gly Lys Phe Ser Gln Thr Cys 1 5 10 15 TAC AACTCC GCT ATC CAG GGT TCC GTT CTG ACC TCC ACC TGC GAA CGT 96 Tyr Asn SerAla Ile Gln Gly Ser Val Leu Thr Ser Thr Cys Glu Arg 20 25 30 ACC AAC GGTGGT TAC AAC ACC TCC TCC ATC GAC CTG AAC TCC GTT ATC 144 Thr Asn Gly GlyTyr Asn Thr Ser Ser Ile Asp Leu Asn Ser Val Ile 35 40 45 GAA AAC GTT GACGGT TCC CTG AAA TGG CAG CCG TCC AAC TTC ATC GAA 192 Glu Asn Val Asp GlySer Leu Lys Trp Gln Pro Ser Asn Phe Ile Glu 50 55 60 ACC TGC CGT AAC ACCCAG CTG GCT GGT TCC TCC GAA CTG GCT GCT GAA 240 Thr Cys Arg Asn Thr GlnLeu Ala Gly Ser Ser Glu Leu Ala Ala Glu 65 70 75 80 TGC AAA ACC CGT GCTCAG CAG TTC GTT TCC ACC AAA ATC AAC CTG GAC 288 Cys Lys Thr Arg Ala GlnGln Phe Val Ser Thr Lys Ile Asn Leu Asp 85 90 95 GAC CAC ATC GCT AAC ATCGAC GGT ACC CTG AAA TAC GAA 327 Asp His Ile Ala Asn Ile Asp Gly Thr LeuLys Tyr Glu 100 105 109 amino acids amino acid linear protein 4 Asp TyrLys Asp Asp Asp Asp Lys Leu Gly Lys Phe Ser Gln Thr Cys 1 5 10 15 TyrAsn Ser Ala Ile Gln Gly Ser Val Leu Thr Ser Thr Cys Glu Arg 20 25 30 ThrAsn Gly Gly Tyr Asn Thr Ser Ser Ile Asp Leu Asn Ser Val Ile 35 40 45 GluAsn Val Asp Gly Ser Leu Lys Trp Gln Pro Ser Asn Phe Ile Glu 50 55 60 ThrCys Arg Asn Thr Gln Leu Ala Gly Ser Ser Glu Leu Ala Ala Glu 65 70 75 80Cys Lys Thr Arg Ala Gln Gln Phe Val Ser Thr Lys Ile Asn Leu Asp 85 90 95Asp His Ile Ala Asn Ile Asp Gly Thr Leu Lys Tyr Glu 100 105

What is claimed is:
 1. A recording medium comprising: a program causinga computer to execute the steps of: (a) predicting a data storagecondition of a database from a record operation; (b) computing a numberof relocatable areas and a number of areas in an expansion directionbased on the data storage condition predicted in said step (a); and (c)detecting operation timing with respect to the database based on thenumbers computed in said step (b).
 2. A recording medium comprising: aprogram causing a computer to execute the steps of: (a) determiningwhether a new overflow area is generated by a record operation; (b)determining whether fragmentation is generated in a prime area oroverflow areas including the new overflow area linked thereto by therecord operation if it is determined in said step (a) that the newoverflow area is generated; (c) computing a number of relocatable areasand a number of areas in an expansion direction based on a result ofsaid step (b); and (d) detecting operation timing with respect to thedatabase based on the numbers computed in said step (c).
 3. Therecording medium as claimed in claim 2, wherein said step (a) isperformed with respect to each of transactions.
 4. The recording mediumas claimed in claim 2, wherein said step (d) is performed if a newnumber of relocatable areas and a new number of areas in the expansiondirection are computed in said step (c).
 5. The recording medium asclaimed in claim 2, wherein said step (d) detects the operation timingwith respect to the database from a rate of use of overflow areas, aratio of relocatable overflow areas, and a ratio of overflow areas inthe expansion direction.
 6. The recording medium as claimed in claim 2,wherein said step (b) defines the prime area and the overflow areaslinked thereto as a set in determining whether the fragmentation isgenerated in the prime area or the overflow areas linked thereto by therecord operation.
 7. The recording medium as claimed in claim 6, whereinsaid step (b) determines the set to be a relocatable area if said step(b) determines that the fragmentation is generated in the set, anddetermines the set to be in the expansion direction if said step (b)determines that the fragmentation is prevented from being generated inthe set.
 8. The recording medium as claimed in claim 7, wherein saidstep (b) continues to determine the set of the prime page and theoverflow pages linked thereto to be the relocatable area even if a newoverflow page is generated in the set once said step (b) determines theset to be the relocatable area.
 9. A method of detecting databaseoperation timing, comprising the steps of: (a) determining whether a newoverflow area is generated by a record operation; (b) determiningwhether fragmentation is generated in a prime area or overflow areasincluding the new overflow area linked thereto by the record operationif it is determined in said step (a) that the new overflow area isgenerated; (c) computing a number of relocatable areas and a number ofareas in an expansion direction based on a result of said step (b); and(d) detecting operation timing with respect to the database based on thenumbers computed in said step (c).
 10. An apparatus for detectingdatabase operation timing, comprising: a first determination part fordetermining whether a new overflow area is generated by a recordoperation; a second determination part for determining whetherfragmentation is generated in a prime area or overflow areas includingthe new overflow area linked thereto by the record operation if it isdetermined by said first determination part that the new overflow areais generated; a computation part for computing a number of relocatableareas and a number of areas in an expansion direction based on adetermination result of said second determination part; and a detectionpart for detecting operation timing with respect to the database basedon the numbers computed by said computation part.